const Sequelize = require('sequelize');
const baseModel = require('../baseModel');

class chapterOpened extends baseModel{
  constructor(){
    super('chapter_opened',{
      stu_id:{
        type: Sequelize.INTEGER,
        allowNull: false,
        primaryKey: true
      },
      chapter_id: {
        type: Sequelize.INTEGER,
        allowNull: false,
        primaryKey: true
      },
      learn_state: {
        type: Sequelize.INTEGER,
        allowNull: false
      }
    });
    this.model = super.getModel();
    this.model.sync();
  }
}

module.exports = new chapterOpened();
